package ua.kpi_java_training.evgeniygusar.module2;

import java.util.Random;

public abstract class Fish {
    public int x, y;
    int X_BORDER, Y_BORDER;
    Fish() {
    Pool mypool = new Pool();
    X_BORDER = mypool.getXBorder();
    Y_BORDER = mypool.getYBorder();
    Borning();
    }

    public void Moving(){
    }

    /**
     * Create random coordinats for new Fishes
     */
    public void Borning() {
        Random rnd_x = new Random(System.currentTimeMillis());
        x=1+rnd_x.nextInt(X_BORDER);
        Random rnd_y = new Random(System.currentTimeMillis());
        y=1+rnd_y.nextInt(Y_BORDER);
    }

    public void showCoordinats() {
        System.out.println("x = " + x + ", y = " + y);
    }
}
